---
title: "SQL-027: CP get agent online policy list"
summary: Retrieve the list of policies accessible to an agent or agency user.
status: draft
owner: SAIF Corporation
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# SQL-027 CP get agent online policy list

This stored procedure call retrieves the list of policies available to an agent or agency user so the library can populate the accessible policy list.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-027 |
| **Operation type** | Read |
| **Execution method** | StoredProc |
| **Database** | SQL Server (BDS) |
| **Schema** | `[unqualified]**` |
| **Command type** | StoredProcedure |
| **Business object** | `clsPolicySecurity` |
| **Criteria property** | `N/A` |
| **Lifecycle method** | `GetPolicyListForAgent` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `@AgentNum` | Input | Decimal | N/A | Agent number identifying the requesting agent or agency. |
| `@ForAgency` | Input | String | N/A | Flag indicating whether the request is for agency access. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| N/A — Stored procedure | SELECT | Procedure body resides in the database. |

## Sample SQL

```sql
-- SQL Server (BDS) stored procedure call (CommandType.StoredProcedure, ResultSet)
-- clsPolicySecurity.GetPolicyListForAgent, executed against DPISql (clsSQLDataLayer)
EXEC cp_get_agent_online_policy_list
  @AgentNum  = @AgentNum,
  @ForAgency = @ForAgency
-- returns columns: policy_num, policy_name
```

> The procedure body resides in the SQL Server (BDS) database; it was not retrievable for this run.

## Operations and processes
- [Retrieve accessible policy list](../operations-processes.md)

## Business rules
- [BR-VP-005: Access granted per user-access-level matrix](../business-rules.md#br-vp-005-access-granted-per-user-access-level-matrix)

## Sources
- `SAIF.Business.View.Policy/clsPolicySecurity.vb`
